package com.wxmblog.photo.controller;

//import org.apache.shiro.authz.annotation.RequiresPermissions;
import com.wxmblog.base.common.web.domain.R;
import com.wxmblog.photo.common.rest.request.user.UserEditRequest;
import com.wxmblog.photo.common.rest.response.user.UserInfoResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiOperationSort;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.wxmblog.photo.service.FrUserService;


/**
 * 前台用户表
 *
 * @author wanglei
 * @email 378526425@qq.com
 * @date 2023-06-14 17:36:34
 */
@RestController
@RequestMapping("photo/fruser")
@Api(tags = "前台-用户信息")
public class FrUserController {

    @Autowired
    private FrUserService frUserService;

    @ApiOperation("编辑个人信息")
    @ApiOperationSort(value = 1)
    @PostMapping("/edit")
    public R<Void> editUser(@RequestBody UserEditRequest request) {
        frUserService.editUser(request);
        return R.ok();
    }

    @ApiOperation("个人信息查询")
    @ApiOperationSort(value = 2)
    @GetMapping("/info")
    public R<UserInfoResponse> userInfo() {
        return R.ok(frUserService.userInfo());
    }


}
